{% extends "PATHomeBundle::base.html.twig" %}    
{% block body %}
        <div class="tunnelCartImg">
            <div class="tunnelShoppingCart"></div>
            <div class="tunnelTruckOff"></div>
            <div class="tunnelCardsOff"></div>
            <div class="tunnelOrderOff"></div>
        </div>
        <h1>Mon panier</h1>
        {% if cart is defined %}
            <div class="cartTable">
                {% if cart.productList is defined %}
                    <table>
                        <tbody>
                            <tr>
                                <td>Image</td><td>Nom</td><td>Quantité</td><td>Supprimer</td>
                            </tr>
                            {% for id, array in cart.productList %}
                                <tr>
                                    <td>{% if array.product.picture is defined %}
                                            <a href="{{ path('pat_product_display', { 'id':id }) }}">
                                                <img src="{{ asset('bundles/patproduct/images/' ~ array.product.picture.getUrl) }}" style="max-height: 70px;max-width: 70px;" alt="{{ array.product.picture.getTitle() }}" />
                                            </a>
                                        {% endif %}

                                    </td>
                                    <td>
                                        {% if array.product.name is defined %}
                                            {{ array.product.name }}
                                        {% endif %}
                                    </td>
                                    <td>
                                        <div class="productQuantity">
                                            <div class="reduceProductQuantity" id="{{ id }}"><strong>-</strong></div>
                                                 {{ array.quantity }} 
                                            <div class="addProductQuantity" id="{{ id }}"><strong>+</strong></div>
                                        </div>
                                    </td>
                                    <td><div class="deleteProductFromCart" id="{{ id }}"></div></td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                {% else %}
                    <div class="psykokwak_emptycart"></div>
                    <div class="text_emptycart">
                        Vous n'avez aucun article dans votre panier.<br />
                        Veuillez parcourir notre catalogue pour choisir un article de votre choix.
                    </div>
                {% endif %}
                  <br /><br /><br />   
            </div>
        
            <a href="#" onClick="javascript:history.back();" class="generic_link">Retour</a>
            {% if cart.productList is defined %}
                <a href="{{ path('pat_cart_displaysteps', { 'step':'2' }) }}" class="generic_link">Valider mon panier</a>
            {% endif %}
                
        {% endif %}
   
{% endblock %}